package com.lujianfei.netease_android_shareelement.ui

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import com.lujianfei.netease_android_shareelement.R
import com.lujianfei.netease_android_shareelement.beans.ListEntity
import kotlinx.android.synthetic.main.activity_share_element_detail.*

class ShareElementDetailFragment : Fragment() {

    companion object {
        const val KEY_DATA = "key_data"
    }

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        return inflater.inflate(R.layout.activity_share_element_detail, container, false)
    }
    override fun onActivityCreated(savedInstanceState: Bundle?) {
        super.onActivityCreated(savedInstanceState)
        val bean = arguments?.getParcelable<ListEntity>(KEY_DATA)
        bean?.let {
            detailIcon.setImageResource(bean.icon)
            detailTitle.text = bean.title
        }
    }
}
